<template>
  <div class="refund-item">
      <div class="item-img-wrap">
          <div class="item-img">
              <img :src="thumb">
          </div>
      </div>
      <div class="item-content">
        <div class="item-name">{{name}}</div>
        <div class="item-desc">{{desc}}</div>
        <p class="item-time">{{time}}</p>
      </div>
      <div class="item-price">
            <div>{{price}}</div>
            <div v-bind:class="{ item_state_done : state == 2 }">{{refund_state[state]}}</div>
      </div>
  </div>
</template>

<script>
export default {
  name: 'refund-item',
  comments: 'refund-item',
  props: {
    itemId: Number,
    thumb: String,
    name: String,
    desc: String,
    time: String,
    price: String,
    state: Number
  },
  data () {
    return {
      refund_state: {
        0: '待受理',
        1: '已受理',
        2: '已完成'
      }
    }
  },
  methods: {
  }
}
</script>
<style lang="postcss" scoped>
.refund-item{
    background-color: #333;
    position: relative;
    border-bottom: 1px solid #666;
    overflow: hidden;
    display: flex;
    justify-content: center;
    width: 100%;
    height: 80px;
}
.item-img-wrap{
    width: 30%;
    position: relative;
    align-self: center;
    text-align: -webkit-center;
}
.item-img{
    height: 60px;
    width: 60px;
    overflow: hidden;
    // border-radius: 50%;
    // background-size: 100%;
}
img{
    width: auto;
    height: 100%;
}
.item-content{
    text-align: left;
    max-height: 100%;
    width: 60%;
    color: #f8f8f8;
    align-self: center;
}
.item-name{
    font-weight: bold;
}
.item-price{
    font-weight: bold;
    text-align: right;
    width: 30%;
    color: #f8f8f8;
    align-self: center;
}
.item-desc{
    font-size: 0.8rem;
    margin-top: 0px;
    color: #f8f8f8;
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
}
.item-time{
    font-size: 0.8rem;
    margin: 0px;
    color: yellow;
}
.item-price>div{
    padding-right: 4px;
}
.item_state_done{
    color:#f8f8f8;
}
</style>
